<h1>重置用户密码</h1>
<form nz-form [formGroup]="validateForm" class="login-form" (ngSubmit)="submitForm()">
  <nz-form-item>
    <nz-form-control>
      <nz-input-group nzPrefixIcon="user">
        <input type="text" nz-input formControlName="username"/>
      </nz-input-group>
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-control nzErrorTip="请输入密码!">
      <nz-input-group nzPrefixIcon="lock">
        <input type="password" nz-input formControlName="password" placeholder="密码"/>
      </nz-input-group>
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-control [nzErrorTip]="errorTpl">
      <nz-input-group nzPrefixIcon="lock">
        <input type="passwordAgain" nz-input formControlName="passwordAgain" placeholder="重复密码"/>
        <ng-template #errorTpl let-control>
          <ng-container *ngIf="control.hasError('required')">请再次输入密码!</ng-container>
          <ng-container *ngIf="control.hasError('confirm')">两次密码不相同!</ng-container>
        </ng-template>
      </nz-input-group>
    </nz-form-control>
  </nz-form-item>

  <button nz-button class="login-form-button login-form-margin" [nzType]="'primary'"
          [disabled]="validateForm.invalid">确定
  </button>
</form>
